package com.smartlifev30.mvp.module;

import android.content.Context;

import com.smartlifev30.utils.SharedPreferencesUtil;

import smartlifev30.com.sdk.api.CallBack;
import smartlifev30.com.sdk.api.gateway_app.GatewayMgmtImpl;
import smartlifev30.com.sdk.api.gateway_app.UserMgmtGatewayImpl;
import smartlifev30.com.sdk.bean.response.LoginGatewayResponse;
import smartlifev30.com.sdk.bean.response.LoginResponse;

/**
 * @author tys
 * @date 2018/8/31
 */

public class GatewayActivityModule implements IGatewayActivityModule {

    @Override
    public String getUserName(Context context) {
        return SharedPreferencesUtil.getString(context, SharedPreferencesUtil.USER_NAME);
    }

    @Override
    public String getPwd(Context context) {
        return SharedPreferencesUtil.getString(context, SharedPreferencesUtil.USER_PWD);
    }

    @Override
    public void loginGateway(String userName, String password, String sn, CallBack<LoginGatewayResponse> callBack) {
        UserMgmtGatewayImpl userMgmtGateway = new UserMgmtGatewayImpl();
        userMgmtGateway.loginGatewayByPwd(userName, password, sn, callBack);
    }
}
